package shopping;


public class Goods {
    private int id;
    private String name;
    private double price;

    public Goods(String name, double price) {

        this.name = name;
        this.price = price;
    }

    @Override
    public String toString()
    {
        return this.name+'-'+this.price+'-'+this.id;
    }

    @Override
    public boolean equals(Object obj)
    {
        if(obj instanceof Goods) {
            Goods c = (Goods) obj;
            return this.name.equals(c.name)&&this.price==c.price;

        }
        else return super.equals(obj);
    }

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}
}